﻿
<?php

require('_config-rating.php');

mysql_query("SET NAMES 'utf8'");

if (isset($_POST["gListName"])) 
{ 
	$ok="true";
	$gListId  = $_POST["gListName"]; 
} else {
	return;
	//echo "Oyun Listesi Alınamadı.";
}


if (!isset($_POST["sec"])) 
{ 
	return;
}

if (!$con)
  {
  die('Could not connect: ' . mysql_error());
}

//$sql = "SELECT * FROM games WHERE gameId IN (SELECT gameId FROM favorites WHERE personId =$userid ) LIMIT $start_from, $pageInclude"; 

$sql = "select * from games where gameId in (SELECT gameId FROM listgamerelations l where l.listId = "; 
$sql=$sql."(select gameListId from gamelist where gameListId=$gListId and userId=$userid))";

$rs_result = mysql_query ($sql,$con); 
?> 
<?php 
while ($row = mysql_fetch_array($rs_result)) { 

$outputUi2 =$outputUi2. '<div class="fbgm2"> <img hspace="10px" align="center" src="'.$row["picUrl"].'" alt="AK Status" width="50" height="50" style="float:left;"/>';
$outputUi2=$outputUi2.'<span class="fbx-tiny" style="margin-top:5px;font-size:12px;">'.$row["gameName"].'</span> <br/>';
$outputUi2=$outputUi2.'<span style="margin-top:5px;margin-left:40px; font-size:11px;"><a href="play.php?gameid='.$row["gameId"].'&game='.$row["gameName"].'">Hemen Oyna</a></span></div>';

}

//echo $outputUi2;
mysql_close();


function getListGameCategory($str){
	$start= strpos($str,"/");
	$end= strripos($str,"/");
	$l= $end-$start-1;
	
	$categ =  substr ($str, $start+1, $l);
	$gameid=1;
	if($categ=="Beceri_Games"){
		$gameid=1;
	}elseif ($categ=="Macera_Games"){
		$gameid=2;
	}elseif ($categ=="Cocuk_Games"){
		$gameid=3;
	}elseif ($categ=="Kiz_Games"){
		$gameid=4;
	}elseif ($categ=="Erkek_Games"){
		$gameid=5;
	}elseif ($categ=="Zeka_Games"){
		$gameid=6;
	}elseif ($categ=="Spor_Games"){
		$gameid=7;
	}elseif ($categ=="Yaris_Games"){
		$gameid=8;
	}elseif ($categ=="Barbie_Games"){
		$gameid=9;
	}elseif ($categ=="Savas_Games"){
		$gameid=10;
	}
	
	return $gameid;
}

function getListGameName($str){
	$start= strripos($str,"/");
	$end= strpos($str,".");
	$l= $end-$start-1;
	return substr ($str, $start+1, $l);
}

?>  
